/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package drt;

import java.util.LinkedHashSet;

/**
 *
 * @author phong
 */
public class DRSReferent extends DrtEntityVariable {
        
    public DRSReferent(String name) {
        super(name);
    }
            
    @Override
    public boolean equals(Object other) {
        if (other instanceof DRSReferent) {
            return this.name.equals(((DRSReferent)other).name);
        }
        else 
            return false;
    }
    
    @Override
    public int hashCode() {
        return this.name.hashCode();
    }
            
    @Override
    public void getRefs(LinkedHashSet<DRSReferent> refs) {
        refs.add(this);
    }
    
    @Override
    public void getAllVariables(LinkedHashSet<DrtVariable> vars) {
    }
    
    @Override
    public DRSReferent simplify() {
        return this;
    }
    
    @Override
    public DRSReferent replace(DrtVariable var, DrtExpression exp) {
        if (this.equals(var))
            return (DRSReferent)exp;
        else 
            return this;
    }
}
